<template>
  <div>
    <Drawer
      :value="visible"
      :styles="{ padding: '0 0 60px' }"
      width="1000"
      @on-visible-change="drawerChange"
    >
      <div class="drawer-main">
        <div class="header">
          <Icon custom="iconfont iconmanjianmanzhe" size="60" />
          <div>
            <div class="title">{{ formValidate.inbound_order_no }}</div>
            <div>
              {{$t('page.stock.status')}} :
              <span v-if="formValidate.status==1">{{$t('page.inboundTabs.1')}}</span>
              <span v-if="formValidate.status==2">{{$t('page.inboundTabs.2')}}</span>
              <span v-if="formValidate.status==4">{{$t('page.inboundTabs.4')}}</span>
              <span v-if="formValidate.status==5">{{$t('page.inboundTabs.5')}}</span>
              <span v-if="formValidate.status==6">{{$t('page.inboundTabs.6')}}</span>
              <span v-if="formValidate.status==7">{{$t('page.inboundTabs.7')}}</span>
            </div>
          </div>
        </div>
        <Tabs v-model="currentTab" @on-click="onhangeTab">
          <TabPane
            v-for="(item, index) in headTab"
            :key="index"
            :label="item.title"
            :name="item.name"
          ></TabPane>
        </Tabs>
        <Form
            class="formValidate"
            ref="formValidate"
            :model="formValidate"
            :label-width="labelWidth"
            :label-position="labelPosition"
            :disabled="!!pid"
            @submit.native.prevent
        >
          <Row :gutter="24" type="flex" v-show="currentTab === '1'">
            <!-- 订单信息-->
            <Col span="24" class="delivery_type">
              <FormItem :label="$t('page.stock.arrival_type')+'：'" prop="">
                {{deliveryTypeLabel}}
              </FormItem>
            </Col>
            <Col span="24">
              <FormItem :label="$t('page.stock.select_date')+'：'" prop="ship_date">
                {{formValidate.ship_date}}
<!--                <DatePicker type="datetime" @on-change="onchangeOff" :options="endPickOptions" :value="formValidate.ship_date" v-model="formValidate.ship_date" placeholder="" format="yyyy-MM-dd" style="width: 260px;"></DatePicker>-->
                <!--              <div class="tips">开启定时下架后，系统会在设置时间下架该商品。下架时间需晚于开售时间，商品才能定时开售。</div>-->
              </FormItem>
            </Col>

            <Col span="24">
              <FormItem :label="$t('page.stock.po')+':'" prop="order_nos">
                {{formValidate.order_nos}}
              </FormItem>
            </Col>
            <Col span="24">
              <FormItem :label="$t('page.stock.container_or_tracking')+':'" prop="tracking_number">
                {{formValidate.tracking_number}}
              </FormItem>
            </Col>
          </Row>
          <!--入库列表-->
          <Row :gutter="24" type="flex" v-show="currentTab === '2'">
            <Col span="24">
              <FormItem :label="$t('page.customer.export')+'：'" props="spec_type">
                <Button
                    class="mr20"
                    type="primary"
                    @click="exportStock"
                >{{$t('page.customer.export')}}</Button>
              </FormItem>
            </Col>
            <Col span="24">
              <FormItem :label="$t('page.stock.PKG_Qty')+'：'" props="spec_type">
                {{ manyFormValidate.length }}
              </FormItem>
            </Col>
            <!-- 箱子添加-->
            <Col span="24">
              <FormItem :label="$t('page.stock.package_list')+'：'">
                <Table
                    :data="manyFormValidate"
                    :columns="header"
                    border
                >
                  <template slot-scope="{ row, index }" slot="caseName">
                    <p>{{ manyFormValidate[index].caseName }}</p>
                  </template>
                  <template slot-scope="{ row, index }" slot="items">
                    <Table
                        :data="manyFormValidate[index].items"
                        :columns="freightHeader"
                        class="freight-table-header"
                        size="small"
                        :showHeader="false"
                    >
                      <template slot-scope="{ row: nestedRow, index: itemsi }" slot="omsSku">
                        <p>{{ manyFormValidate[index].items[itemsi].omsSku }}</p>
                      </template>
                      <template slot-scope="{ row:quantityRow, index:quantityi }" slot="quantity">
                        <p v-if="formValidate.status == '1'">{{ manyFormValidate[index].quantity * manyFormValidate[index].items[quantityi].quantity }}</p>
                        <p v-else>{{manyFormValidate[index].items[quantityi].quantity }}</p>

                      </template>
                    </Table>
                  </template>
                  <template slot-scope="{ row, index }" slot="quantity">
                    {{ manyFormValidate[index].quantity }}
                  </template>
<!--                  <template slot-scope="{ row, index }" slot="all_quantity">-->
<!--                    {{ calculateAllQuantity(index)}}-->
<!--                  </template>-->
                </Table>
              </FormItem>
            </Col>
          </Row>
          <!-- 其他设置-->
          <Row v-show="currentTab === '3'">
            <Col span="24">
              <FormItem :label="$t('page.stock.note')+'：'" prop="">
                <Input
                    v-model="formValidate.remark"
                    type="textarea"
                    :rows="5"
                    :placeholder="$t('page.stock.note')"
                    v-width="'50%'"
                />
              </FormItem>
            </Col>
          </Row>
          <!-- 变更日志-->
          <Row v-show="currentTab === '4'">
            <Col span="24">
              <vxe-table
                  border="inner"
                  ref="xTable"
                  class="mt25"
                  :data="inboundOperationLogList">
                <vxe-column field="update_time" :title="$t('page.stock.timestamp')"></vxe-column>
                <vxe-column field="activity" :title="$t('page.customer.operate')" ></vxe-column>
                <vxe-column field="operator" :title="$t('page.customer.operator')"></vxe-column>
              </vxe-table>
            </Col>
          </Row>
          <!-- 费用明细-->
          <Row v-show="currentTab === '5'">
            <Col span="24">
              <vxe-table
                  border="inner"
                  ref="xTable"
                  class="mt25"
                  :data="inboundByBizList">
                <vxe-column field="fees_item_name" :title="$t('page.stock.billing_name')"  min-width="250"></vxe-column>
                <vxe-column field="price" :title="$t('page.order.price')">
                  <template v-slot="{ row }">
                    <span v-if="row.cost ==  undefined">--</span>
                    <span v-else>{{row.cost}}</span>
                  </template>
                </vxe-column>
                <vxe-column field="qty" :title="$t('page.order.quantity')">
                  <template v-slot="{ row }">
                    <span v-if="row.qty ==  undefined">--</span>
                    <span v-else>{{row.qty}}</span>
                  </template>
                </vxe-column>
<!--                <vxe-column field="" title="计算维度">-->
<!--                  <template v-slot="{ row }">-->
<!--                    <span>&#45;&#45;</span>-->
<!--                  </template>-->
<!--                </vxe-column>-->
<!--                <vxe-column field="" title="应用单据类型" min-width="100">-->
<!--                  <template v-slot="{ row }">-->
<!--                    <span>&#45;&#45;</span>-->
<!--                  </template>-->
<!--                </vxe-column>-->
                <vxe-column field="description" :title="$t('page.stock.description')">
                  <template v-slot="{ row }">
                    <span v-if="row.description ==  undefined">--</span>
                    <span v-else>{{row.description}}</span>
                  </template>
                </vxe-column>
                <vxe-column field="paidStatus" :title="$t('page.order.status')">
                  <template v-slot="{ row }">
                    <span>--</span>
                  </template>
                </vxe-column>
                <vxe-column field="feesItemType" :title="$t('page.stock.billing_mode')">
                  <template v-slot="{ row }">
                    <span>--</span>
                  </template>
                </vxe-column>
                <vxe-column field="" :title="$t('page.stock.billing_mode_price')">
                  <template v-slot="{ row }">
                    <span>--</span>
                  </template>
                </vxe-column>
              </vxe-table>
              <div style="text-align: right;padding-right: 20px;padding-top: 20px;">
                {{ $t('page.order.price') }}：<span style="color: red">
                 <Numeral :value="all_price" format="0,0.00">
                      <template #prefix>
                        <strong>$</strong>
                      </template>
                 </Numeral>
              </span>
              </div>
            </Col>
          </Row>
          <!-- 其他设置 -->
          <Spin size="large" fix v-if="spinShow"></Spin>
        </Form>

      </div>
      <Card :bordered="false" dis-hover class="fixed-card">
        <Form>
          <FormItem>
            <Button v-if="currentTab !== '1'" @click="upTab">{{ $t('page.order.last_step') }}</Button>
            <Button
              type="primary"
              class="submission"
              v-if="currentTab !== '5'"
              @click="downTab('formValidate')"
              >{{ $t('page.order.next_step') }}</Button
            >
          </FormItem>
        </Form>
      </Card>
    </Drawer>

  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
import Setting from '@/setting';
import util from '@/libs/util';
import uploadPictures from '@/components/uploadPictures';
import freightTemplate from '@/components/freightTemplate';
import wangeditor from '@/components/wangEditor/index.vue';
import vuedraggable from 'vuedraggable';


import {parcelList} from "@api/product";
import {freightInfoApi} from "@api/freight"; //引入uploadByPieces方法
import {
  boundInfoApi,
  boundInfoExcelFileApi,
  findStoreInboundByBizId,
  findStoreInboundOperationLogId
} from "@api/inbound";
import {exportStoreCustomerList} from "@api/storeCustomer";
export default {
  components: {
    uploadPictures,
    freightTemplate,
    wangeditor,
    draggable: vuedraggable,
  },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    freightId: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      pid: 0,
      freightList:[],
      roterPre: Setting.roterPre,
      all_price:0,
	  arrivalTypeData:[
	    {
	      "children": [],
	      "value": 1,
	      "label": "箱",
	      "pid": 0
	    },
	    {
	      "children": [],
	      "value": 1,
	      "label": "托盘(栈板)",
	      "pid": 0
	    },
	  ],
      type: 0,
      spinShow: false,
      openSubimit: false,
      formValidate: {
        inbound_order_no:"",
        out_bounding_biz_no:"",//ob号
        delivery_type:0,//送达方式
        ship_date:0,//预计发货日期
        order_nos:"",//采购订单号，多个逗号分隔
        tracking_number:"",//采购订单号
        remark: "",
        id: 0,
        spec_type: 0,
        attrs:[],
      },
      inboundByBizList:[],
      inboundOperationLogList:[],
      freightHeader: [
        {
          align: "center",
          minWidth: 200,
          slot: "omsSku",
          title: "SKU",
        },
        {
          align: "center",
          minWidth: 80,
          slot: "quantity",
          title: $t('page.stock.Qty'),
        },
        // {
        //   align: "center",
        //   minWidth: 80,
        //   slot: "action",
        //   title: "操作",
        // },
      ],
      header: [
        {
          align: "center",
          minWidth: 100,
          slot: "caseName",
          title: $t('page.stock.package_no'),
        },
        {
          align: "center",
          minWidth: 500,
          slot: "items",
          title: $t('page.stock.items'),
          renderHeader: h => h('div', { style: { display: 'flex', flexDirection: 'column', alignItems: 'center',width:"500px" } }, [
            // 第一行：产品
            h('div', { style: { marginBottom: '4px', fontWeight: 'bold' } }, $t('page.stock.items')),

            // 第二行：三个小格子
            h('div', {
              style: { display: 'flex', justifyContent: 'space-between', width: '100%',borderTop:'1px solid #ebeef5' }
            }, [
              h('span', { style: { textAlign: 'center',borderRight:'1px solid #ebeef5', width:'60%' } }, 'SKU'),
              h('span', { style: { textAlign: 'center', borderRight:'0px solid #ebeef5', width:'40%'} },  $t('page.stock.Qty')),
            ])
          ])
        },
        {
          align: "center",
          minWidth: 100,
          slot: "quantity",
          title: $t('page.stock.box_qty'),
        },
        // {
        //   align: "center",
        //   minWidth: 130,
        //   slot: "action",
        //   title: "操作",
        // },
      ],
      distanceSelect:[
        {
          value: 'cm',
          label: 'cm'
        },
        {
          value: 'in',
          label: 'in'
        },
      ],
      massSelect:[
        {
          value: 'lb',
          label: 'lb'
        },
        {
          value: 'kg',
          label: 'kg'
        },
      ],
      manyFormValidate: [],
      images: [],
      currentTab: "1",
      isChoice: "",
      modalPic: false,
      picTit: "",
      tableIndex: 0,
      upload: {
        videoIng: false, // 是否显示进度条；
      },
      videoIng: false, // 是否显示进度条；
      progress: 0, // 进度条默认0
      videoLink: "",
      // arrivalTypeData:[
      //   {
      //     "children": [],
      //     "value": 1,
      //     "label": "箱",
      //     "pid": 0
      //   },
      //   {
      //     "children": [],
      //     "value": 1,
      //     "label": "托盘(栈板)",
      //     "pid": 0
      //   },
      // ],
      datePickerOptions: {
        disabledDate (date) {
          return date && date.valueOf() < Date.now() - 86400000;
        }
      },
    };
  },
  computed: {
    headTab(){
      return [
        { title: $t('page.stock.basic_information'), name: "1" },
        { title: $t('page.stock.inbound_item_list'), name: "2" },
        { title: $t('page.stock.note'), name: "3" },
        { title: $t('page.stock.operation_log'), name: "4" },
        { title: $t('page.stock.charge_fees'), name: "5" },
      ]
    },
    ...mapState('store/layout', ['isMobile', 'menuCollapse']),
    labelWidth() {
      return this.isMobile ? undefined : 120;
    },
    labelPosition() {
      return this.isMobile ? 'top' : 'right';
    },
deliveryTypeLabel() {
    const map = {
      0: "",
      1: "Case",
      2: "Pallet",
      3: "20 FT Container",
      4: "20 FT HC Container",
      5: "40 FT Container",
      6: "40 FT HC Container",
      7: "45 FT HC Container",
      8: "48 FT Container",
      9: "53 FT Container"
    };
    return map[this.formValidate.delivery_type] || '';
  },
    endPickOptions() {
      const that = this;
      return {
        disabledDate(time) {
          if (that.formValidate.is_show == '1') {
            return time.getTime() < Date.now();
          }
          if (that.formValidate.auto_on_time) {
            return (
              time.getTime() <
              new Date(that.formValidate.auto_on_time).getTime() + 86400000
            );
          }
          return '';
        },
      };
    },
  },
  watch: {
    currentTab(value) {
      this.$nextTick(() => {
        if (this.pid && value == 3) {
          this.$refs.wangeditor.editor.disable();
        } else {
          this.$refs.wangeditor.editor.enable();
        }
      });
    }
  },
  created() {
    this.getParcelList();
  },
  mounted() {
    this.setCopyrightShow({ value: false });
    if (this.freightId !== '0' && this.freightId) {
      this.getInfo();
      this.getFindStoreInboundByBizId();
      this.getFindStoreInboundOperationLogId();
    }
    if(this.$route.query.type){
      this.type = this.$route.query.type;
    }else {
      this.type = 0;
    }
  },
  methods: {
    ...mapMutations('admin/layout', [
      'setCopyrightShow'
    ]),
    async exportStock() {
      try {
        this.exportLoading = true;
        let res; // 在函数作用域声明
        // 1. 调用导出接口获取文件信息
        res = await boundInfoExcelFileApi(this.freightId);
        // 2. 检查响应是否成功
        if (res.code !== 0) {
          throw new Error(res.msg || '导出失败');
        }

        // 3. 获取文件信息
        const fileInfo = res.data;

        // 4. 使用文件URL下载文件
        await this.downloadFile(fileInfo);

        // 5. 显示成功消息
        Message.success('导出成功，文件已开始下载');

      } catch (error) {
        // 错误处理
        Message.error(error.message || '导出失败，请重试');
        console.error('导出错误:', error);
      } finally {
        this.exportLoading = false;
      }
    },
    async downloadFile(fileInfo) {
      try {
        // 1. 创建下载链接（优先使用 download_url，再使用 exports_url）
        // const downloadUrl = fileInfo.download_url || fileInfo.exports_url;
        const downloadUrl = fileInfo.exports_url;
        // 2. 创建隐藏的<a>标签触发下载
        const link = document.createElement('a');
        link.href = downloadUrl;

        // 从URL中提取文件名，或自定义文件名
        const fileName = downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1);
        link.download = fileName; // 设置下载文件名

        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
      } catch (error) {
        console.error('文件下载错误:', error);
        throw new Error('文件下载失败: ' + error.message);
      }
    },
    getParcelList() {
      parcelList({})
          .then(async (res) => {
            let data = res.data;
            this.freightList = data.list
          })
          .catch((res) => {
            this.$Message.error(res.msg);
          });
    },
    // 计算产品总数量
    calculateAllQuantity(index) {
      var quantity = 0
      this.manyFormValidate[index].items.forEach(item => {
        quantity += item.quantity
      })
      return quantity
    },
    //删除箱子
    delBox(index){
      this.manyFormValidate.splice(index, 1);
    },
    //添加箱子
    addBox() {
      this.manyFormValidate.push({
        caseName:this.today()+"-F" +this.manyFormValidate.length+1,
        quantity:0,
        distanceUnit:"cm",
        massUnit:"kg",
        trackingNumber:"",
        remark:"",
        length:0,
        width:0,
        height:0,
        weight1:0,
        weight2:0,
        inboundingType:0,
        items:[]
      });
    },
    //删除产品
    delProduct(index,quantityi){
      this.manyFormValidate[index].items.splice(quantityi, 1);
    },
    //添加产品
    addProduct(index) {
      this.manyFormValidate[index].items.push({
        omsSku:"",
        quantity:0
      },);
    },
    today() {
      // 获取当前日期对象
      const currentDate = new Date();
      // 获取年份的后两位
      let year = currentDate.getFullYear().toString().slice(-2);

      // 获取月份，注意 getMonth() 返回值是 0 - 11，所以要加 1
      let month = (currentDate.getMonth() + 1).toString();
      // 如果月份是个位数，前面补零
      if (month.length === 1) {
        month = '0' + month;
      }
      // 获取日期
      let day = currentDate.getDate().toString();
      // 如果日期是个位数，前面补零
      if (day.length === 1) {
        day = '0' + day;
      }
      // 拼接成最终格式
      const formattedDate = year + month + day;
      return  formattedDate
    },

    //设置预计到货时间
    onchangeOff(e){
      this.formValidate.estimate_arrive_time = e
    },

    initBran(data){
      data.map(item=>{
        item.value = item.value.toString();
        if(item.children && item.children.length){
          this.initBran(item.children);
        }
      })
    },
    cancel() {
      this.$router.push({path:`${Setting.roterPre}/freight/index`});
    },

    // 上传头部token
    getToken() {
      this.header["Authori-zation"] = "Bearer " + util.cookies.get("token");
    },
    infoData(data){
      this.formValidate = data;
      this.manyFormValidate = data.attrs
      this.deliveryTypeLabel()
    },

    //对象数组去重；
    unique(arr) {
      const res = new Map();
      return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
    },
    // 运费模板
    getList() {

    },
    // 上一页；
    upTab() {
      this.currentTab = (Number(this.currentTab) - 1).toString();
    },
    // 下一页；
    downTab(name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.currentTab = (Number(this.currentTab) + 1).toString();
        }else{
          this.$Message.warning("请完善数据");
        }
      })
    },
    // 详情
    getInfo() {
      let that = this;
      that.spinShow = true;
      boundInfoApi(this.freightId)
          .then((res) => {
            let data = res.data.info;
            this.infoData(data);
            this.spinShow = false;
          })
          .catch((res) => {
            this.spinShow = false;
            this.$Message.error(res.msg);
          });
    },

    // 获取费用明细
    getFindStoreInboundByBizId() {
      findStoreInboundByBizId(this.freightId)
          .then((res) => {
            this.all_price = 0
            let data = res.data;
            this.inboundByBizList = data
            for (let i = 0; i < data.length; i++) {
              this.all_price += data[i].cost
            }
          })
          .catch((res) => {
            this.$Message.error(res.msg);
          });
    },
    // 获取变更记录
    getFindStoreInboundOperationLogId() {
      findStoreInboundOperationLogId(this.freightId)
          .then((res) => {
            let data = res.data;
            this.inboundOperationLogList = data
          })
          .catch((res) => {
            this.$Message.error(res.msg);
          });
    },
    // tab切换
    onhangeTab(name) {
      this.currentTab = name;
    },
    // 关闭图片上传模态框
    changeCancel(msg) {
      this.modalPic = false;
    },
    drawerChange(e) {
      if (e) {
        this.currentTab = '1';
        this.getInfo();
        this.getFindStoreInboundByBizId();
        this.getFindStoreInboundOperationLogId();
      } else {
        this.$emit('update:visible', false);
      }
    },
    // 提交
    handleSubmit(name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.openSubimit = false;
          this.formValidate.attrs = this.manyFormValidate;

          // freightAddApi(this.formValidate)
          //     .then(async (res) => {
          //       this.openSubimit = true;
          //       this.$Message.success(res.msg);
          //       if (this.$route.params.id === "0") {
          //         cacheDelete().catch((err) => {
          //           this.$Message.error(err.msg);
          //         });
          //       }
          //       setTimeout(() => {
          //         this.$router.push({ path: `${Setting.roterPre}/freight/index` });
          //       }, 500);
          //     })
          //     .catch((res) => {
          //       this.openSubimit = false;
          //       this.$Message.error(res.msg);
          //     });
        }
      });
    },
    // 表单验证
    validate(prop, status, error) {
      if (status === false) {
        this.$Message.warning(error);
      }
    },
  },
};
</script>

<style lang="stylus" scoped>
.video-style {
  width: 100%;
  height: 100% !important;
  border-radius: 10px;
}

.select-add {
  width: 200px;
  margin-left: 6px;
  margin-right: 10px;
}

.input-display {
  display: none;
}

.width-add {
  width: 200px;
}

.custom-input {
  width: 100px;
  margin-right: 10px;
}

.asterisk {
  position: relative;

  .asteriskInfo {
    position: absolute;
    color: #ed4014;
    left: 73px;
    top: 8px;

    &.on {
      left: 62px;
    }
  }
}

.specsList {
  /deep/.ivu-table-header table {
    border: 0 !important;
  }

  /deep/.ivu-table-header thead tr th {
    padding: 0 !important;
    background-color: #EEEEEE !important;
  }

  /deep/.ivu-table-cell {
    padding: 0 !important;
  }

  /deep/.ivu-table-border th, /deep/.ivu-table-border td {
    border-right: unset;
  }

  /deep/.ivu-table td {
    height: 59px;
  }
  &.on{
    width 50% !important;
    /deep/.ivu-table{
      width 100% !important;
    }
    /deep/.ivu-table td{
      height 40px;
      padding 0 !important;
    }
    /deep/.ivu-table-cell{
      padding 0 16px !important;
    }
  }
}

.fixed-card {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  box-shadow: 0 -1px 2px rgb(240, 240, 240);

  /deep/ .ivu-card-body {
    padding: 15px 16px 14px !important;
  }

  .ivu-form-item {
    margin-bottom: 0;
  }

  /deep/ .ivu-form-item-content {
    text-align: center;
  }

  .ivu-btn {
    height: 32px;
    padding: 0 20px;
  }
}

.seeCatMy {
  color: #2d8cf0;
  cursor: pointer;
}

.addCustom_content {
  margin-top: 20px;

  .custom_box {
    margin-bottom: 10px;
  }

  .addfont {
    display: inline-block;
    font-size: 13px;
    font-weight: 400;
    color: #1890FF;
    cursor: pointer;
  }
}

.addCustomBox {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1890FF;

  .btn {
    cursor: pointer;
    width: max-content;
  }
}

.checkAlls /deep/.ivu-checkbox-inner {
  width: 14px;
  height: 14px;
}

.checkAlls /deep/.ivu-checkbox-wrapper {
  font-size: 12px;
}

.lines {
  border-bottom: 1px dashed #eee;
  margin-bottom: 20px;
}

.iosfont {
  font-size: 20px !important;
}

.selectOn {
  color: #2d8cf0;
}

.ifam {
  width: 344px;
  height: 644px;
  background: url('../../../assets/images/phonebg.png') no-repeat center top;
  background-size: 344px 644px;
  padding: 40px 20px;
  padding-top: 50px;
  margin: 0 auto 0 20px;

  .content {
    height: 560px;
    overflow: hidden;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */
    overflow-x: hidden;
    overflow-y: auto;
  }

  .content::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }
}

.offShow {
  position: absolute;
}

.goodsShow /deep/.ivu-radio-group-vertical .ivu-radio-wrapper {
  height: 35px;
  line-height: 35px;
}

.videbox {
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
  border: 1px dashed #DDDDDD;
  line-height: 50px;
  text-align: center;
  color: #898989;
  font-size: 30px;
  font-weight: 400;
  cursor: pointer;
}

.brandName {
  /deep/.ivu-cascader {
    display: inline-block;
  }
}

.formValidate {
  .addClass {
    color: #1890FF;
    margin-left: 14px;
    padding: 9px 0;
    cursor: pointer;
  }
}

.freightType {
  width: 120px;
  height: 60px;
  background: #FFFFFF;
  border-radius: 3px;
  border: 1px solid #E7E7E7;
  float: left;
  text-align: center;
  padding-top: 8px;
  position: relative;
  cursor: pointer;
  line-height: 23px;
  margin-right: 12px;

  &.on {
    border-color: #1890FF;
  }

  .name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
  }

  .title {
    font-size: 12px;
    font-weight: 400;
    color: #999999;
  }

  .jiao {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 26px solid #1890FF;
    border-left: 26px solid transparent;
  }

  .iconfont {
    position: absolute;
    bottom: -3px;
    right: 1px;
    color: #FFFFFF;
    font-size: 12px;
  }
}

.labelInput {
  border: 1px solid #dcdee2;
  width: 50%;
  padding: 0 5px;
  border-radius: 5px;
  min-height: 30px;
  cursor: pointer;

  .span {
    color: #c5c8ce;
  }

  .iconxiayi {
    font-size: 12px;
  }
}

.labelClass {
  /deep/.ivu-form-item-content {
    line-height: unset;
  }
}

.ivu-checkbox-wrapper {
  margin-right: 19px;
}

.list-group {
  margin-left: -8px;
}

.borderStyle {
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
}

.drag {
  cursor: move;
}

.move-icon {
  width: 30px;
  cursor: move;
  margin-right: 10px;
}

.move-icon .icondrag2 {
  font-size: 26px;
  color: #d8d8d8;
}

.maxW /deep/.ivu-select-dropdown {
  max-width: 600px;
}

#shopp-manager .ivu-table-wrapper {
  border-left: 1px solid #dcdee2;
  border-top: 1px solid #dcdee2;
}

.noLeft {
  >>> .ivu-form-item-content {
    margin-left: 0 !important;
  }
}

#shopp-manager .ivu-form-item .tips {
  display: inline-bolck;
  font-size: 12px;
  font-weight: 400;
  color: #999999;
  margin-top: 14px;
}

.iview-video-style {
  width: 40%;
  height: 180px;
  border-radius: 10px;
  background-color: #707070;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.iview-video-style .iconv {
  color: #fff;
  line-height: 180px;
  width: 50px;
  height: 50px;
  display: inherit;
  font-size: 26px;
  position: absolute;
  top: -74px;
  left: 50%;
  margin-left: -25px;
}

.iview-video-style .mark {
  position: absolute;
  width: 100%;
  height: 30px;
  top: 0;
  background-color: rgba(0, 0, 0, 0.5);
  text-align: center;
}

.uploadVideo {
  margin-left: 10px;
}

.submission {
  margin-left: 10px;
}

.color-list .tip {
  color: #c9c9c9;
}

.color-list .color-item {
  width: 70px;
  height: 28px;
  line-height: 28px;
  color: #fff;
  margin-right: 10px;
  border-radius: 2px;
  text-align: center;

  .num {
    color: #1890FF;
    width: 14px;
    height: 14px;
    text-align: center;
    line-height: 14px;
    border-radius: 50%;
    background-color: #fff;
    margin-right: 6px;
  }
}

.color-list .color-item.blue {
  background-color: #1E9FFF;
}

.color-list .color-item.yellow {
  background-color: rgb(254, 185, 0);
}

.color-list .color-item.green {
  background-color: #009688;
}

.color-list .color-item.red {
  background-color: #ed4014;
}

.color-list .color-item.colorBlue {
  background: linear-gradient(270deg, #5ECFFF 0%, #0084FF 100%);
}

.columnsBox {
  margin-right: 10px;
}

.priceBox {
  width: 100%;
}

.rulesBox {
  display: flex;
  flex-wrap: wrap;
}

.pictrueBox {
  display: inline-block;
}

.pictrueTab {
  width: 40px !important;
  height: 40px !important;
}

.pictrue {
  width: 60px;
  height: 60px;
  border: 1px dotted rgba(0, 0, 0, 0.1);
  margin-right: 15px;
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  cursor: pointer;

  img {
    width: 100%;
    height: 100%;
  }

  .btndel {
    position: absolute;
    z-index: 1;
    width: 20px !important;
    height: 20px !important;
    left: 46px;
    top: -4px;
  }
}

.upLoad {
  width: 58px;
  height: 58px;
  line-height: 58px;
  border: 1px dotted rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
}

.curs {
  cursor: pointer;
}

.inpWith {
  width: 60%;
}

.labeltop {
  >>> .ivu-form-item-label {
    float: none !important;
    display: inline-block !important;
    margin-left: 120px !important;
    width: auto !important;
  }

  .icondrop-down {
    font-size: 12px;
    margin-left: 5px;
  }
}

.video-icon {
  background-image: url('https://cdn.oss.9gt.net/prov1.1/1/icons.png'); // cdn.oss.9gt.net/prov1.1/1/icons.png);
  // background-color: #fff;
  background-position: -9999px;
  background-repeat: no-repeat;
}

.progress {
  margin-top: 10px;
}

.new_tab {
  >>>.ivu-tabs-nav .ivu-tabs-tab {
    padding: 4px 16px 20px !important;
    font-weight: 500;
  }
}

.header {
  display: flex;
  align-items: center;
  padding: 30px 0 25px 25px;
  font-size: 13px;
  color: #606266;

  .iconfont {
    margin-right: 12px;
    color: #2d8cf0;
  }

  .title {
    font-weight: 500;
    font-size: 16px;
    color: #000000;
  }
}

.drawer-main {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 62px;
  left: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.ivu-tabs {
  >>>.ivu-tabs-bar {
    border-bottom: 0;
    margin-bottom: 30px;
    background-color: #F5F7FA;
  }

  >>>.ivu-tabs-tab {
    height: 40px;
    padding: 0 20px;
    font-size: 13px;
    line-height: 40px;
    color: #000000;

    &:hover {
      color: #000000 !important;
    }
  }

  >>>.ivu-tabs-tab-active {
    background-color: #FFFFFF;
  }

  >>>.ivu-tabs-ink-bar {
    top: 0;
    bottom: auto;
  }

  .ivu-tabs-tabpane {
    padding: 0 24px;
  }
}
</style>